<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title></title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
  <link rel="stylesheet" type="text/css" href="{$_G['URL']['PLUGIN_CSS']}shopplan/static/css/reset.css?v=1">
  <link rel="stylesheet" type="text/css" href="{$_G['URL']['PLUGIN_CSS']}shopplan/static/css/swiper.min.css?v=1">
  <link rel="stylesheet" type="text/css" href="{$_G['URL']['PLUGIN_CSS']}shopplan/static/css/style.css?v=12">
  <script src="{$_G['URL']['PLUGIN_CSS']}shopplan/static/js/screen.js?v=1"></script>
  <script src="{$_G['URL']['PLUGIN_CSS']}shopplan/static/js/jquery.js?v=1"></script>
  <script src="{$_G['URL']['PLUGIN_CSS']}shopplan/static/js/swiper.min.js?v=1"></script>
  <script src="{$_G['URL']['PLUGIN_CSS']}shopplan/static/js/LiftEffect.js?v=1"></script>
 </head>
 <body class="witheBg" >
 	<div class="dataTitle">
    	<span>周日</span>
        <span>周一</span>
        <span>周二</span>
        <span>周三</span>
        <span>周四</span>
        <span>周五</span>
        <span>周六</span>
    </div>
    <div class="dataBox">
        <div class="swiper-container"> 
         <div class="swiper-wrapper">
            <div class="refresh">释放刷新</div>



            <div class="loadmore">加载更多</div>
        </div>
        <!--<div class="swiper-scrollbar"></div>-->
     </div>
<!--  </div> -->
 </body>
 <script>
　　window.onload = function(){ 
        var postUrl = '/{php echo createMobileUrl("wx",array("planedid"=>$planedid,"themeid"=>$themeid,"shopid"=>$shopid,"birthday"=>$birthday,"from"=>"mobile","r"=>"shopplan.getmonths"));}';
        $.ajax({
          type:'POST',
          dataType:'json',
          url:postUrl,
          success:function (res){
            var data = res.data;
            var ruleBtn = data.ruleBtn_html;
            $(".refresh").after(ruleBtn);
			
			refreshEnd= false;
			times=0;//加载次数
			oriSpeed=300
			
			var swiper = new Swiper('.swiper-container',{
				speed: oriSpeed,
				slidesPerView:'auto',
				freeMode: true,
			    direction: 'vertical',
				setWrapperSize: true,
				scrollbar: {
			        el: '.swiper-scrollbar',
			    },
				on:{
			
					//下拉释放刷新
					touchEnd: function(){
						swiper=this
						refreshText=swiper.$el.find('.refresh')
			            if(this.translate>100){
			                swiper.setTransition(this.params.speed);
			                swiper.setTranslate(100);
				            swiper.touchEventsData.isTouched=false;//跳过touchEnd事件后面的跳转(4.0.5)
				            refreshText.html('刷新中')
							
				            swiper.allowTouchMove=false;
							setTimeout(function(){
            //模仿AJAX
			
								swiper.removeAllSlides();
			
			                    var postUrl = '/{php echo createMobileUrl("wx",array("planedid"=>$planedid,"themeid"=>$themeid,"shopid"=>$shopid,"birthday"=>$birthday,"from"=>"mobile","r"=>"shopplan.getmonths"));}';
			                    $.ajax({
			                      type:'POST',
			                      dataType:'json',
			                      url:postUrl,
			                      success:function (res){
			                        var data = res.data;
			                        var ruleBtn = data.ruleBtn_html;
			                        swiper.appendSlide(ruleBtn); 
			                        refreshText.html('刷新完成');
			                        refreshEnd=true;
			                        swiper.allowTouchMove=true;
                                    times=0;
			                      }
			                    });
			
			
							},1000)
							
			             }
						 
			        },
					touchStart: function(){
						if(refreshEnd==true){
			                this.$el.find('.refresh').html('释放刷新');
							refreshEnd=false;
						}
			        },
					
					//加载更多
					momentumBounce: function(){
            //非正式反弹回调函数，上拉释放加载更多可参考上例
						swiper=this

						if(swiper.translate<-100){
				
							swiper.allowTouchMove=false;//禁止触摸
							swiper.params.virtualTranslate=true;//定住不给回弹
			                setTimeout(function(){
            //模仿AJAX
			
			                    var postUrl = '/{php echo createMobileUrl("wx",array("planedid"=>$planedid,"themeid"=>$themeid,"shopid"=>$shopid,"birthday"=>$birthday,"from"=>"mobile","r"=>"shopplan.getmonths"));}';
                                postUrl+='&times='+times;

			                    $.ajax({
			                      type:'POST',
			                      dataType:'json',
			                      url:postUrl,
			                      success:function (res){
			                        var data = res.data;
			                        var ruleBtn = data.ruleBtn_html;
			                        swiper.appendSlide(ruleBtn); 

			                      }
			                    });

								swiper.params.virtualTranslate=false;
								swiper.allowTouchMove= true;
								times++
						    },1000)
							
						}
					},
				}
			});
          }
        });
　　}


	$('.dataBox').on('click','.cur',function(){
		$('.dataBox li').removeClass('cured');
		$(this).addClass('cured');
	})
  </script>
 {include file='base/addlog'}
</html>
